Custom Systems Overview
Introduction
Welcome to the Custom Applications documentation. Here, we provide guidelines for integrating "Custom API Language Models" and "Custom RAG Applications" using DynamoEval's flexible adapter system.
General Features
The Custom Applications by Dynamo AI facilitate integration with your model endpoints through REST APIs. Key features include:
- Acting as a bridge between DynamoEval and custom systems' endpoint
- Requiring only a REST API
- Supporting various authentication methods (e.g., No Auth, Bearer Token, API Key)
- Enabling request/response transformations using JSONata expressions
Authentication Mechanisms
DynamoEval currently supports few common authentication types like:
-
No Authentication (no_auth)
- No additional headers required
-
Bearer Token (bearer)
- Uses an authorization header with a bearer token
-
API Key (api_key)
- Customizable authorization header with an API key
JSONata Transformations
JSONata is a lightweight query and transformation language for JSON data. DynamoEval uses JSONata to transform requests and responses. See the JSONata documentation and JSONata playground for more details.
- Request Transformation: Converts DynamoEval's standard request format to your API's format
- Response Transformation: Converts your API's response format to DynamoEval's expected format
The transformations are applied in this order:
- DynamoEval request → Request Transform → Your API
- Your API response → Response Transform → DynamoEval
Basic Example
# Input format:
# { "message": "Hello", "metadata": { "timestamp": 123 } }
# Desired output format:
# { "text": "Hello", "time": 123 }
transformation_expression = """
{
"text": message, // Direct field mapping
"time": metadata.timestamp // Nested field access
}
"""
Advanced Features
For detailed examples of JSONata transformations:
- See Custom API Language Models for LLM-specific transformations
- See Custom RAG Applications for RAG-specific transformations
Helper Prompt for JSONata Transformations
To simplify the process of writing JSONata code for transforming JSON objects, you can use the following LLM prompt and your favorite AI assistant. This prompt helps generate JSONata expressions by providing a sample of how your custom RAG adapter understands the data. Replace X
with your specific JSON format:
Create a JSONata expression to transform the following JSON object:
Input: { "query": "user query text", "top_k": 3 }
Output: X
Example prompt
Create a JSONata expression to transform the following JSON object:
Input: { "query": "user query text", "top_k": 3 }
Output: { "searchQuery": query, "limit": top_k }